/*
*Copyright (c) Nikhil Jain.
*Project ICARUS, communications and 
*artificial intelligence.
*/



/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
 */
package javadrone.statedata;

//~--- non-JDK imports --------------------------------------------------------

import javadrone.Sensor;

//~--- JDK imports ------------------------------------------------------------

import java.io.Serializable;

import javax.vecmath.Vector3d;

/**
 *
 * @author Nikzzay
 * install in both client and server
 */
public class NavigationData extends StateData<NavigationData.NavigationState> {
    private static final Sensor DESCRIPTOR = Sensor.NAV_STATE;

    public NavigationData(NavigationState ns) {
        super(ns, DESCRIPTOR);
    }

    @Override
    public String toString() {
        return "ALL NAVIGATIONAL DATA: " + getData().toString();
    }

    public static class NavigationState implements Serializable {
        private final Vector3d coords, angles;
        private final boolean  isAlive;
        private final boolean  isHovering;
        private final boolean  isLanding;

        public NavigationState() {
            this(new Vector3d(), new Vector3d(), false, false, false);
        }

        public NavigationState(Vector3d coords, Vector3d angles, boolean isHovering, boolean isLanding,
                               boolean isAlive) {
            this.isHovering = isHovering;
            this.coords     = coords;
            this.angles     = angles;
            this.isLanding  = isLanding;
            this.isAlive    = isAlive;
        }

        public Vector3d getCoords() {
            return new Vector3d(coords);
        }

        public Vector3d getAngles() {
            return new Vector3d(angles);
        }

        public boolean isHovering() {
            return isHovering;
        }

        public boolean isLanding() {
            return isLanding;
        }

        public boolean isAlive() {
            return isAlive;
        }

        @Override
        public String toString() {
            return "[IS ALIVE: " + isAlive + " COORDS: " + coords + " ANGLES: " + angles + " HOVERING STATUS: "
                   + isHovering + " LANDING STATUS: " + isLanding + "]";
        }
    }
}


//~ Formatted by Jindent --- http://www.jindent.com
